const CLOUD_SERVICE_NAME = 'APIs';

module.exports = (data) => {
  return new Promise((resolve, reject) => {
    wx.cloud.callFunction({
      name: CLOUD_SERVICE_NAME,
      data,
      complete: res => {
        resolve(res.result);
      },
      fail: error => {
        reject(error);
      }
    });
  });
}
